package com.jewaton.auth.commons.util;

import java.util.Calendar;
import java.util.Date;

/**   
 *    
 * 日期工具类
 *
 */
public class DayOfWeekUtil {
	
	public static String getWeekByDate(Date date){
		Calendar c = Calendar.getInstance();
		c.setTime(date);
		String resultString = null;
		int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
		switch (dayOfWeek) {
		case 1:
		resultString = "Sunday"; // sunday
		break;
		case 2:
		resultString = "Monday"; // monday
		break;
		case 3:
		resultString = "Tuesday"; // tuesday
		break;
		case 4:
		resultString = "Wednesday"; // wednesday
		break;
		case 5:
		resultString = "Thursday"; // thursday
		break;
		case 6:
		resultString = "Friday"; // friday
		break;
		case 7:
		resultString = "Saturday"; // saturday
		break;
		default:
		resultString = "Error Date";
		break;
		}
		return resultString;
	}
}
